'''
Created on Oct 21, 2014

@author: azhelezny
'''
def fibCycle(n, k):
    
    prevYoung = 1  
    prevMateur = 0
    
    currentYoung = 0
    currentMateur = 0
    
    death = []
    death.append(1)
    
    counter = 1;
    while(counter<n):
        
        currentYoung = prevMateur
        
        if(counter < k):
            currentMateur = prevMateur + prevYoung
        else:
            currentMateur = prevMateur + prevYoung - death[counter-k]
            
        death.append(currentYoung)
        
        prevMateur = currentMateur
        prevYoung = currentYoung
        
        counter +=1 
    return currentYoung + currentMateur

print(format(fibCycle(92, 20)))